package com.lihao.demo1.utils;

import android.content.Context;
import android.util.AttributeSet;

import ren.qinc.numberbutton.NumberButton;

/**
 * Created by Administrator on 2018/7/14.
 */

public class MyNumberButton extends NumberButton {
    OnNumberListener mOnNumberListener;
    public MyNumberButton(Context context) {
        super(context);
    }

    public MyNumberButton(Context context, AttributeSet attrs) {
        super(context, attrs);
    }
    public void setNumberChangeListener(OnNumberListener mOnNumberListener) {
        this.mOnNumberListener=mOnNumberListener;
    }

    @Override
    public void onTextChanged(CharSequence s, int start, int before, int count) {
        super.onTextChanged(s, start, before, count);
        if(mOnNumberListener!=null){
            mOnNumberListener.onClick(s, start, before, count);
        }
    }
    public interface OnNumberListener {
        void onClick(CharSequence s, int start, int before, int count);
    }
}
